<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    hostname: new URL('https://wzc570738205.github.io').hostname,
    root: '/',
    scheme: 'Gemini',
    version: '7.7.0',
    exturl: true,
    sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
    copycode: {"enable":true,"show_result":true,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":true,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
  };
</script>

  <meta name="description" content="概述本文总结一下 Hexo 搭建博客的主要流程，能够在日后快速恢复博客环境。 Hexo 的官方文档写的已经很全面了，本文仅将一些注意点列出。">
<meta property="og:type" content="article">
<meta property="og:title" content="利用 Hexo + Github Pages 搭建博客">
<meta property="og:url" content="https://wzc570738205.github.io/2020/01/10/hexo-blog/index.html">
<meta property="og:site_name" content="王志超的博客">
<meta property="og:description" content="概述本文总结一下 Hexo 搭建博客的主要流程，能够在日后快速恢复博客环境。 Hexo 的官方文档写的已经很全面了，本文仅将一些注意点列出。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-01-10T11:10:33.000Z">
<meta property="article:modified_time" content="2020-01-20T07:16:25.888Z">
<meta property="article:author" content="王志超">
<meta property="article:tag" content="blog">
<meta property="article:tag" content="github">
<meta property="article:tag" content="hexo">
<meta property="article:tag" content="next">
<meta property="article:tag" content="优化">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://wzc570738205.github.io/2020/01/10/hexo-blog/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>利用 Hexo + Github Pages 搭建博客 | 王志超的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">王志超的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <h1 class="site-subtitle" itemprop="description">今天你更博学了吗</h1>
      
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-首页">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-关于">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-标签">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-分类">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-归档">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocorrect="off" autocapitalize="none"
           placeholder="搜索..." spellcheck="false"
           type="text" id="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result"></div>

</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL3d6YzU3MDczODIwNQ==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://wzc570738205.github.io/2020/01/10/hexo-blog/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/logo.png">
      <meta itemprop="name" content="王志超">
      <meta itemprop="description" content="记录前端的点点滴滴">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="王志超的博客">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          利用 Hexo + Github Pages 搭建博客
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-01-10 11:10:33" itemprop="dateCreated datePublished" datetime="2020-01-10T11:10:33+00:00">2020-01-10</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-01-20 07:16:25" itemprop="dateModified" datetime="2020-01-20T07:16:25+00:00">2020-01-20</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Hexo/" itemprop="url" rel="index">
                    <span itemprop="name">Hexo</span>
                  </a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2020/01/10/hexo-blog/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/10/hexo-blog/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>本文总结一下 Hexo 搭建博客的主要流程，能够在日后快速恢复博客环境。</p>
<p>Hexo 的官方文档写的已经很全面了，本文仅将一些注意点列出。</p>
<a id="more"></a>
<div class="note success no-icon">
            <p>欢迎加入前端交流群：<a href="//shang.qq.com/wpa/qunwpa?idkey=f528775f242a7c39fe8512383febb8990e621bf97354c2fb82f6832097b7c501" target="_blank" rel="noopener">749539640</a> </p>
          </div>
<p>安装 Hexo 的文档参考：</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3poLWNuL2RvY3MvaW5kZXguaHRtbA==" title="https://hexo.io/zh-cn/docs/index.html">官宣-Hexo 文档<i class="fa fa-external-link"></i></span></li>
</ul>
<h2 id="前提"><a href="#前提" class="headerlink" title="前提"></a>前提</h2><p>安装 Hexo 之前，你的电脑上需要有</p>
<ul>
<li>Node.js</li>
<li>Git</li>
</ul>
<p>如果是 Mac 用户， 您在编译时可能会遇到问题，请先到 App Store 安装 Xcode，Xcode 完成后，启动并进入 <code>Preferences -&gt; Download -&gt; Command Line Tools -&gt; Install</code> 安装命令行工具</p>
<h2 id="安装-Hexo"><a href="#安装-Hexo" class="headerlink" title="安装 Hexo"></a>安装 Hexo</h2><p>全局安装 <code>hexo-cli</code>：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli</span><br></pre></td></tr></table></figure>

<p>如果遇到权限的问题，可以使用如下命令：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo chown -R $(whoami) &#x2F;usr&#x2F;local&#x2F;lib&#x2F;node_modules&#x2F;</span><br></pre></td></tr></table></figure>

<p>设置 <code>/usr/local/lib/node_modules/</code> 文件夹属于当前用户。</p>
<p>此外，如果你要使用 root 权限安装的话，可以使用 <code>sudo -s</code> 切为 root 用户进行相关操作。这么做的话，会将一些文件夹的默认属组设置为 root 了，不推荐。</p>
<p>npm 权限问题：</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9ucG0uY29tbXVuaXR5L3QvZ2xvYmFsLWluc3RhbGxzLXN1ZG8tbnBtLWktZy1mYWlsLW9uLW1hYy1hZnRlci02LTUtdXBncmFkZS13b3Jrcy1maW5lLWFmdGVyLTYtNC0xLWRvd25ncmFkZS80MDgy" title="https://npm.community/t/global-installs-sudo-npm-i-g-fail-on-mac-after-6-5-upgrade-works-fine-after-6-4-1-downgrade/4082">Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly96aHVhbmxhbi56aGlodS5jb20vcC8zNTg1Njg0MQ==" title="https://zhuanlan.zhihu.com/p/35856841">npm，yarn如何查看源和换源<i class="fa fa-external-link"></i></span></li>
</ul>
<h2 id="建站"><a href="#建站" class="headerlink" title="建站"></a>建站</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo init MyBlog</span><br><span class="line">cd MyBlog</span><br><span class="line">npm install</span><br></pre></td></tr></table></figure>

<p>执行完毕之后，博客其实已经 OK 了：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo g</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>执行上面命令即可本地预览博客内容了。</p>
<h2 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h2><p><span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3poLWNuL2RvY3MvY29uZmlndXJhdGlvbg==" title="https://hexo.io/zh-cn/docs/configuration">官宣-站点配置文件<i class="fa fa-external-link"></i></span> 内容中介绍了很多字段的用途</p>
<p>Hexo 提供快速一键部署，将博客部署到 GIthub Pages。</p>
<p>安装 <code>hexo-deployer-git</code>：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ cd MyBlog</span><br><span class="line">$ npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure>

<p>修改站点配置文件中的配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># npm install hexo-deployer-git --save</span><br><span class="line">deploy:</span><br><span class="line">- type: git</span><br><span class="line">  repo: git@github.com:Michael728&#x2F;michael728.github.io.git</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>

<p>执行部署：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo d</span><br></pre></td></tr></table></figure>

<h2 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h2><p><span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3poLWNuL2RvY3MvY29tbWFuZHM=" title="https://hexo.io/zh-cn/docs/commands">hexo 常用指令<i class="fa fa-external-link"></i></span></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">hexo version # 显示hexo版本</span><br><span class="line">hexo new &lt;title&gt; # 创建新文章</span><br><span class="line">hexo g&#x2F;generate # 生成静态文件</span><br><span class="line">hexo clean # 清除缓存文件和已生成的静态文件（public）</span><br><span class="line">hexo server # 启动本地服务器</span><br><span class="line">hexo d&#x2F;deploy # 部署网站</span><br><span class="line">hexo list &lt;type&gt; # 列出网站资料</span><br></pre></td></tr></table></figure>

<p>npm 常用指令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">npm install 模块名 -g --save # g全局安装 save安装包信息将加入到dependencies（生产阶段的依赖）</span><br><span class="line">npm install gulp@3.9.1 # 指定版本</span><br><span class="line">npm install # 该命令可以根据dependencies配置安装所有的依赖包</span><br><span class="line">npm update [-g] 模块名</span><br><span class="line">npm outdated 模块名 # 检查模块是否过时</span><br><span class="line">npm ls -g # 查看全局安装的模块</span><br><span class="line">npm uninstall 模块名</span><br><span class="line">npm info hexo-cli # 查看hexo-cli模块的信息</span><br></pre></td></tr></table></figure>

<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly93d3cuamlhbnNodS5jb20vcC8wODdkODM5ZTFkMGM=" title="https://www.jianshu.com/p/087d839e1d0c">npm常用命令<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cDovL3d3dy5jbmJsb2dzLmNvbS9QZXVuWmhhbmcvcC81NTUzNTc0Lmh0bWw=" title="http://www.cnblogs.com/PeunZhang/p/5553574.html">【原】npm 常用命令详解<i class="fa fa-external-link"></i></span></li>
</ul>
<h2 id="Hexo-写作技巧"><a href="#Hexo-写作技巧" class="headerlink" title="Hexo 写作技巧"></a>Hexo 写作技巧</h2><ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9iZXN0enVvLmNuL3Bvc3RzLzMxNDcwNDczMzYuaHRtbA==" title="https://bestzuo.cn/posts/3147047336.html">Sanarous-hexo博客Next主题进阶写作技巧<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmxpaGoubWUvcG9zdC9uZXh0LXRhZy1wbHVnaW4taW5zdHJ1Y3Rpb24uaHRtbA==" title="https://blog.lihj.me/post/next-tag-plugin-instruction.html">NexT 主题内置标签<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cDovL3llYXJpdG8uY24vcG9zdHMvaGV4by13cml0aW5nLXNraWxscy5odG1s" title="http://yearito.cn/posts/hexo-writing-skills.html">Hexo 搭建个人博客系列：写作技巧篇<i class="fa fa-external-link"></i></span></li>
</ul>
<h3 id="Note"><a href="#Note" class="headerlink" title="Note"></a>Note</h3><p>语法：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;% note [class] [no-icon] %&#125;</span><br><span class="line">这里写你需要写的内容</span><br><span class="line">&#123;% endnote %&#125;</span><br><span class="line"></span><br><span class="line">&#x2F;&#x2F; 注意上面的class和no-icon属性是可以选择的</span><br><span class="line">[class]   : default | primary | success | info | warning | danger.</span><br><span class="line">[no-icon] : Disable icon in note.</span><br></pre></td></tr></table></figure>

<p>示例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&#123;% note success no-icon %&#125;</span><br><span class="line">success形式的类别</span><br><span class="line">&#123;% endnote %&#125;</span><br></pre></td></tr></table></figure>

<p>效果：</p>
<div class="note success no-icon">
            <p>success形式的类别</p>
          </div>

<p>这里使用 <code>no-icon</code> 表示不显示图标，可选，默认会带有图标。</p>
<h3 id="使用主题自带-FontAwesome-图标"><a href="#使用主题自带-FontAwesome-图标" class="headerlink" title="使用主题自带 FontAwesome 图标"></a>使用主题自带 FontAwesome 图标</h3><p>源码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">- &lt;i class&#x3D;&quot;fa fa-pencil&quot;&gt;&lt;&#x2F;i&gt; 铅笔</span><br><span class="line">- &lt;i class&#x3D;&quot;fa fa-cloud-upload&quot;&gt;&lt;&#x2F;i&gt; 上传</span><br><span class="line">- &lt;i class&#x3D;&quot;fa fa-download&quot;&gt;&lt;&#x2F;i&gt; 下载</span><br></pre></td></tr></table></figure>

<p>效果：</p>
<ul>
<li><i class="fa fa-pencil"></i> 铅笔</li>
<li><i class="fa fa-cloud-upload"></i> 上传</li>
<li><i class="fa fa-download"></i> 下载</li>
</ul>
<h3 id="文本居中"><a href="#文本居中" class="headerlink" title="文本居中"></a>文本居中</h3><p>源码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;% cq %&#125;</span><br><span class="line">人生乃是一面镜子，</span><br><span class="line">从镜子里认识自己，</span><br><span class="line">我要称之为头等大事，</span><br><span class="line">也只是我们追求的目的！</span><br><span class="line">&#123;% endcq %&#125;</span><br></pre></td></tr></table></figure>

<p>效果：</p>
<blockquote class="blockquote-center"><p>人生乃是一面镜子，<br>从镜子里认识自己，<br>我要称之为头等大事，<br>也只是我们追求的目的！</p>
</blockquote>

<h3 id="主题自带-label-标签"><a href="#主题自带-label-标签" class="headerlink" title="主题自带 label 标签"></a>主题自带 label 标签</h3><p>首先在主题 <code>_config.xml</code> 配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"># Label tag.</span><br><span class="line">label: true</span><br></pre></td></tr></table></figure>

<p>源码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;% label primary@primary内容 %&#125;</span><br></pre></td></tr></table></figure>

<p>效果：</p>
<span class="label primary">primary内容</span>

<h3 id="主题自带-tabs-标签"><a href="#主题自带-tabs-标签" class="headerlink" title="主题自带 tabs 标签"></a>主题自带 tabs 标签</h3><p>主题配置文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"># Tabs tag</span><br><span class="line">tabs:</span><br><span class="line">  enable: true</span><br><span class="line">  transition:</span><br><span class="line">    tabs: true</span><br><span class="line">    labels: true</span><br><span class="line">  border_radius: 0</span><br></pre></td></tr></table></figure>

<p>语法：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#123;% tabs [Unique name], [index] %&#125;</span><br><span class="line">&lt;!-- tab [Tab caption]@[icon] --&gt;</span><br><span class="line">Any content (support inline tags too).</span><br><span class="line">&lt;!-- endtab --&gt;</span><br><span class="line">&#123;% endtabs %&#125;</span><br></pre></td></tr></table></figure>

<ul>
<li><code>Unique name</code> 为每个标签页组唯一的名称</li>
<li><code>index</code> 为初始激活的标签页</li>
<li><code>Tab caption</code> 为标签页名称，不指定时为所属标签页组名称加索引</li>
<li><code>icon</code> 为 <code>Font awesome图标</code>，可选</li>
</ul>
<p>源码示例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;% tabs 选项卡, 2 %&#125;</span><br><span class="line">&lt;!-- tab --&gt;</span><br><span class="line">这是选项卡 1 内容</span><br><span class="line">&lt;!-- endtab --&gt;</span><br><span class="line">&lt;!-- tab --&gt;</span><br><span class="line">这是选项卡 2 内容</span><br><span class="line">&lt;!-- endtab --&gt;</span><br><span class="line">&lt;!-- tab --&gt;</span><br><span class="line">这是选项卡 3** 哇，你找到我了！φ(≧ω≦*)♪～</span><br><span class="line">&lt;!-- endtab --&gt;</span><br><span class="line">&#123;% endtabs %&#125;</span><br></pre></td></tr></table></figure>

<p>效果：</p>
<div class="tabs" id="选项卡"><ul class="nav-tabs"><li class="tab"><a href="#选项卡-1">选项卡 1</a></li><li class="tab active"><a href="#选项卡-2">选项卡 2</a></li><li class="tab"><a href="#选项卡-3">选项卡 3</a></li></ul><div class="tab-content"><div class="tab-pane" id="选项卡-1"><p>这是选项卡 1 内容</p></div><div class="tab-pane active" id="选项卡-2"><p>这是选项卡 2 内容</p></div><div class="tab-pane" id="选项卡-3"><p>这是选项卡 3<em>* 哇，你找到我了！φ(≧ω≦</em>)♪～</p></div></div></div>

<h3 id="主题自带样式按钮"><a href="#主题自带样式按钮" class="headerlink" title="主题自带样式按钮"></a>主题自带样式按钮</h3><p>源码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;% btn https:&#x2F;&#x2F;www.baidu.com, 点击下载百度, download fa-lg fa-fw %&#125;</span><br></pre></td></tr></table></figure>

<p>效果：</p>
<a class="btn" href="https://www.baidu.com" target="_blank" rel="noopener"><i class="fa fa-download fa-lg fa-fw"></i>点击下载百度</a>

<h2 id="Hexo-其他知识"><a href="#Hexo-其他知识" class="headerlink" title="Hexo 其他知识"></a>Hexo 其他知识</h2><h3 id="图床"><a href="#图床" class="headerlink" title="图床"></a>图床</h3><p>由于一直使用的是「微博图床」，渣浪微博和简书开启了图片防盗链，请大家在博客中加入以下标签来绕过：</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">meta</span> <span class="attr">name</span>=<span class="string">"referrer"</span> <span class="attr">content</span>=<span class="string">"never"</span> /&gt;</span> ​​​​</span><br></pre></td></tr></table></figure>

<p>Next 主题只需要在 <code>themes/next/layout/_partials/head/head.swig</code> 中添加上面一行内容即可。</p>
<h2 id="Next-主题"><a href="#Next-主题" class="headerlink" title="Next 主题"></a>Next 主题</h2><ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvaGV4by10aGVtZS1uZXh0L2Jsb2IvbWFzdGVyL2RvY3MvemgtQ04vUkVBRE1FLm1k" title="https://github.com/theme-next/hexo-theme-next/blob/master/docs/zh-CN/README.md">theme-next/hexo-theme-next<i class="fa fa-external-link"></i></span></li>
</ul>
<h3 id="安装-Next"><a href="#安装-Next" class="headerlink" title="安装 Next"></a>安装 Next</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ cd MyBlog</span><br><span class="line">$ git clone https:&#x2F;&#x2F;github.com&#x2F;theme-next&#x2F;hexo-theme-next themes&#x2F;next</span><br></pre></td></tr></table></figure>

<p>Next 扩展都安装在<code>themes/next/source/lib</code>文件夹下</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd MyBlog</span><br><span class="line">git clone https:&#x2F;&#x2F;github.com&#x2F;theme-next&#x2F;hexo-theme-next themes&#x2F;next</span><br></pre></td></tr></table></figure>

<h3 id="启动-Next-主题"><a href="#启动-Next-主题" class="headerlink" title="启动 Next 主题"></a>启动 Next 主题</h3><p>编辑站点配置文件 <code>_config.yml</code>：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">theme: next # 启用next主题</span><br></pre></td></tr></table></figure>

<h3 id="主题设置"><a href="#主题设置" class="headerlink" title="主题设置"></a>主题设置</h3><ul>
<li><span class="exturl" data-url="aHR0cDovL3RoZW1lLW5leHQuaWlzc25hbi5jb20vZ2V0dGluZy1zdGFydGVkLmh0bWw=" title="http://theme-next.iissnan.com/getting-started.html">next-开始使用<i class="fa fa-external-link"></i></span></li>
</ul>
<h3 id="设置语言"><a href="#设置语言" class="headerlink" title="设置语言"></a>设置语言</h3><p>站点配置文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">language: zh-CN # 最新版中，不再使用zh-Hans</span><br></pre></td></tr></table></figure>

<h3 id="设置菜单"><a href="#设置菜单" class="headerlink" title="设置菜单"></a>设置菜单</h3><p>编辑主题配置文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">menu:</span><br><span class="line">  home: &#x2F; || home</span><br><span class="line">  #about: &#x2F;about&#x2F; || user</span><br><span class="line">  #tags: &#x2F;tags&#x2F; || tags</span><br><span class="line">  #categories: &#x2F;categories&#x2F; || th</span><br><span class="line">  archives: &#x2F;archives&#x2F; || archive</span><br><span class="line">  #schedule: &#x2F;schedule&#x2F; || calendar</span><br><span class="line">  #sitemap: &#x2F;sitemap.xml || sitemap</span><br><span class="line">  #commonweal: &#x2F;404&#x2F; || heartbeat</span><br></pre></td></tr></table></figure>

<p>菜单内容的设置格式是：<code>item name: link || icon</code>。其中 `item name 是一个名称，这个名称并不直接显示在页面上，她将用于匹配图标以及翻译。</p>
<p>设置菜单项的显示文本。在第一步中设置的菜单的名称并不直接用于界面上的展示。Hexo 在生成的时候将使用 这个名称查找对应的语言翻译，并提取显示文本。这些翻译文本放置在 NexT 主题目录下的 <code>languages/{language}.yml</code> （<code>{language}</code> 为你所使用的语言）。</p>
<p>icon 使用的是 <span class="exturl" data-url="aHR0cHM6Ly9mb250YXdlc29tZS5jb20vaWNvbnM=" title="https://fontawesome.com/icons">fontawesome<i class="fa fa-external-link"></i></span> 图标，严格区分大小写。</p>
<h3 id="设置头像"><a href="#设置头像" class="headerlink" title="设置头像"></a>设置头像</h3><p>将准备好的头像放置在主题目录下的 <code>source/images/</code> 中。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">avatar:</span><br><span class="line">  # In theme directory (source&#x2F;images): &#x2F;images&#x2F;avatar.gif</span><br><span class="line">  # In site directory (source&#x2F;uploads): &#x2F;uploads&#x2F;avatar.gif</span><br><span class="line">  # You can also use other linking images.</span><br><span class="line">  url: &#x2F;images&#x2F;logo.jpg</span><br></pre></td></tr></table></figure>

<h3 id="百度统计"><a href="#百度统计" class="headerlink" title="百度统计"></a>百度统计</h3><ol>
<li>登录<span class="exturl" data-url="aHR0cDovL3RvbmdqaS5iYWlkdS5jb20v" title="http://tongji.baidu.com/">百度统计<i class="fa fa-external-link"></i></span>， 定位到站点的<span class="exturl" data-url="aHR0cHM6Ly90b25namkuYmFpZHUuY29tL3NjLXdlYi8xODM2MDQ3MC9ob21lL3NpdGUvZ2V0anM/c2l0ZUlkPTEyNzc1NDA0" title="https://tongji.baidu.com/sc-web/18360470/home/site/getjs?siteId=12775404">代码获取页面<i class="fa fa-external-link"></i></span></li>
<li>复制 hm.js? 后面那串统计脚本 id，如：</li>
<li>编辑 主题配置文件， 修改字段 <code>baidu_analytics</code> 字段，值设置成你的百度统计脚本 id</li>
</ol>
<h3 id="阅读次数"><a href="#阅读次数" class="headerlink" title="阅读次数"></a>阅读次数</h3><p>使用 <span class="exturl" data-url="aHR0cHM6Ly9sZWFuY2xvdWQuY24vZGFzaGJvYXJkL2FwcGxpc3QuaHRtbCMvYXBwcw==" title="https://leancloud.cn/dashboard/applist.html#/apps">LeanCloud<i class="fa fa-external-link"></i></span></p>
<p>参考这个 <span class="exturl" data-url="aHR0cHM6Ly9ub3Rlcy53YW5naGFvLndvcmsvMjAxNS0xMC0yMS0lRTQlQjglQkFOZXhUJUU0JUI4JUJCJUU5JUEyJTk4JUU2JUI3JUJCJUU1JThBJUEwJUU2JTk2JTg3JUU3JUFCJUEwJUU5JTk4JTg1JUU4JUFGJUJCJUU5JTg3JThGJUU3JUJCJTlGJUU4JUFFJUExJUU1JThBJTlGJUU4JTgzJUJELmh0bWwjJUU5JTg1JThEJUU3JUJEJUFFTGVhbkNsb3Vk" title="https://notes.wanghao.work/2015-10-21-%E4%B8%BANexT%E4%B8%BB%E9%A2%98%E6%B7%BB%E5%8A%A0%E6%96%87%E7%AB%A0%E9%98%85%E8%AF%BB%E9%87%8F%E7%BB%9F%E8%AE%A1%E5%8A%9F%E8%83%BD.html#%E9%85%8D%E7%BD%AELeanCloud">为NexT主题添加文章阅读量统计功能<i class="fa fa-external-link"></i></span></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">leancloud_visitors:</span><br><span class="line">  enable: true # 启用了 valine，所以这里可以置为 false</span><br><span class="line">  app_id: xxx</span><br><span class="line">  app_key: xxx</span><br></pre></td></tr></table></figure>

<h3 id="设置-RSS"><a href="#设置-RSS" class="headerlink" title="设置 RSS"></a>设置 RSS</h3><p>主题配置文件中，<code>rss</code> 字段设为空，启用，设为 <code>false</code> 则不启用。启用的话，需要安装插键：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-feed --save</span><br></pre></td></tr></table></figure>

<h3 id="添加标签页面"><a href="#添加标签页面" class="headerlink" title="添加标签页面"></a>添加标签页面</h3><ol>
<li>新建页面 <code>hexo new page tags</code></li>
<li>设置页面类型，编辑刚新建的页面，将页面的类型设置为 tags ，主题将自动为这个页面显示标签云<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">title: 标签</span><br><span class="line">date: 2014-12-22 12:39:04</span><br><span class="line">type: &quot;tags&quot;</span><br><span class="line">---</span><br></pre></td></tr></table></figure>

</li>
</ol>
<p>如果有集成评论服务，页面也会带有评论。 若需要关闭的话，请添加字段 comments 并将值设置为 false，如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">title: 标签</span><br><span class="line">date: 2014-12-22 12:39:04</span><br><span class="line">type: &quot;tags&quot;</span><br><span class="line">comments: false</span><br><span class="line">---</span><br></pre></td></tr></table></figure>

<ol start="3">
<li>修改菜单，在菜单中添加链接。编辑 主题配置文件 ， 添加 tags 到 menu 中</li>
</ol>
<p>标签示例：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">title: 标签测试文章</span><br><span class="line">tags:</span><br><span class="line">  - Testing</span><br><span class="line">  - Another Tag</span><br></pre></td></tr></table></figure>

<p>请参阅 <span class="exturl" data-url="aHR0cHM6Ly9oZXhvLmlvL3poLWNuL2RvY3MvZnJvbnQtbWF0dGVyLmh0bWwjJUU1JTg4JTg2JUU3JUIxJUJCJUU1JTkyJThDJUU2JUEwJTg3JUU3JUFEJUJF" title="https://hexo.io/zh-cn/docs/front-matter.html#%E5%88%86%E7%B1%BB%E5%92%8C%E6%A0%87%E7%AD%BE">Hexo 的分类与标签文档<i class="fa fa-external-link"></i></span>，了解如何为文章添加标签或者分类</p>
<p>补充：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">categories:</span><br><span class="line">- Diary</span><br><span class="line">tags:</span><br><span class="line">- PS3</span><br><span class="line">- Games</span><br></pre></td></tr></table></figure>

<p>分类方法的分歧<br>如果您有过使用WordPress的经验，就很容易误解Hexo的分类方式。WordPress支持对一篇文章设置多个分类，而且这些分类可以是同级的，也可以是父子分类。但是Hexo不支持指定多个同级分类。下面的指定方法：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">categories:</span><br><span class="line">- Diary</span><br><span class="line">- Life</span><br></pre></td></tr></table></figure>
<p>会使分类Life成为Diary的子分类，而不是并列分类。因此，有必要为您的文章选择尽可能准确的分类。</p>
<p>并列分类，了解一下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">categories:</span><br><span class="line">- [Linux]</span><br><span class="line">- [Tools]</span><br></pre></td></tr></table></figure>

<p>并列+子分类，再了解一下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">categories:</span><br><span class="line">- [Linux, Hexo]</span><br><span class="line">- [Tools, PHP]</span><br></pre></td></tr></table></figure>

<p>同样的方法，添加分类页面：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new page categories</span><br></pre></td></tr></table></figure>

<h3 id="设置字体"><a href="#设置字体" class="headerlink" title="设置字体"></a>设置字体</h3><p>设置字体可参考:<span class="exturl" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lmlpc3NuYW4uY29tL3RoZW1lLXNldHRpbmdzLmh0bWwjZm9udHMtY3VzdG9taXphdGlvbg==" title="https://theme-next.iissnan.com/theme-settings.html#fonts-customization">官宣-字体<i class="fa fa-external-link"></i></span></p>
<h3 id="设置代码高亮主题"><a href="#设置代码高亮主题" class="headerlink" title="设置代码高亮主题"></a>设置代码高亮主题</h3><p><span class="exturl" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lmlpc3NuYW4uY29tL3RoZW1lLXNldHRpbmdzLmh0bWwjc3ludGF4LWhpZ2hsaWdodC1zY2hlbWU=" title="https://theme-next.iissnan.com/theme-settings.html#syntax-highlight-scheme">代码高亮预览<i class="fa fa-external-link"></i></span></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># Code Highlight theme</span><br><span class="line"># Available value: normal | night | night eighties | night blue | night bright</span><br><span class="line"># https:&#x2F;&#x2F;github.com&#x2F;chriskempson&#x2F;tomorrow-theme</span><br><span class="line">highlight_theme: night eighties</span><br></pre></td></tr></table></figure>

<h3 id="侧边栏社交链接"><a href="#侧边栏社交链接" class="headerlink" title="侧边栏社交链接"></a>侧边栏社交链接</h3><p>主题配置文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">social:</span><br><span class="line">  GitHub: https:&#x2F;&#x2F;github.com&#x2F;Michael728 || github</span><br><span class="line">  微博: https:&#x2F;&#x2F;weibo.com&#x2F;1838446070&#x2F;profile?topnav&#x3D;1&amp;wvr&#x3D;6 || weibo</span><br><span class="line">  博客园: https:&#x2F;&#x2F;www.cnblogs.com&#x2F;michael-xiang&#x2F; || globe</span><br><span class="line">  知乎: https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;michaelXoX || globe</span><br><span class="line">  Twitter: https:&#x2F;&#x2F;twitter.com&#x2F;728_michael || twitter</span><br><span class="line">  Telegram: https:&#x2F;&#x2F;t.me&#x2F;michaelxiang || telegram</span><br></pre></td></tr></table></figure>

<p>图标名称 是 Font Awesome 图标的名字（不必带 <code>fa-</code> 前缀）。 enable 选项用于控制是否显示图标，你可以设置成 false 来去掉图标</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">social_icons:</span><br><span class="line">  enable: true</span><br><span class="line">  icons_only: false</span><br><span class="line">  transition: false</span><br></pre></td></tr></table></figure>

<h3 id="开启打赏功能"><a href="#开启打赏功能" class="headerlink" title="开启打赏功能"></a>开启打赏功能</h3><p>只需要 主题配置文件 中填入 微信 和 支付宝 收款二维码图片地址 即可开启该功能：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">reward_settings:</span><br><span class="line">  # If true, reward would be displayed in every article by default.</span><br><span class="line">  # You can show or hide reward in a specific article throuth &#96;reward: true | false&#96; in Front-matter.</span><br><span class="line">  enable: true</span><br><span class="line">  animation: false</span><br><span class="line">  comment: 我知道是不会有人点的，但万一有人想不开呢👇</span><br><span class="line"></span><br><span class="line">reward:</span><br><span class="line">  wechatpay: &#x2F;images&#x2F;wechatpay.jpg</span><br><span class="line">  alipay: &#x2F;images&#x2F;alipay.png</span><br></pre></td></tr></table></figure>

<h3 id="友情链接"><a href="#友情链接" class="headerlink" title="友情链接"></a>友情链接</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"># Blog rolls</span><br><span class="line">links_icon: link</span><br><span class="line">links_title: 关注列表 #Links</span><br><span class="line">links_layout: block</span><br><span class="line">#links_layout: inline</span><br><span class="line">links:</span><br><span class="line">  #Title: http:&#x2F;&#x2F;example.com</span><br><span class="line">  Blog List: https:&#x2F;&#x2F;michael728.github.io&#x2F;2018&#x2F;09&#x2F;16&#x2F;blog-interesting&#x2F;</span><br><span class="line">  ZeeCoder: https:&#x2F;&#x2F;zcheng.ren&#x2F;posts&#x2F;</span><br><span class="line">  ehlxr: https:&#x2F;&#x2F;ehlxr.me&#x2F;</span><br><span class="line">  卡瓦邦噶: https:&#x2F;&#x2F;www.kawabangga.com&#x2F;</span><br><span class="line">  David Dai: https:&#x2F;&#x2F;blog.stdioa.com&#x2F;</span><br><span class="line">  建站日志: https:&#x2F;&#x2F;michael728.github.io&#x2F;2016&#x2F;09&#x2F;03&#x2F;blog-logfile&#x2F;</span><br></pre></td></tr></table></figure>

<h3 id="站点建立时间"><a href="#站点建立时间" class="headerlink" title="站点建立时间"></a>站点建立时间</h3><p>这个时间将在站点的底部显示，例如 <code>©2013 - 2015</code>。 编辑 主题配置文件，新增字段 since：</p>
<h3 id="订阅微信公众号"><a href="#订阅微信公众号" class="headerlink" title="订阅微信公众号"></a>订阅微信公众号</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"># Wechat Subscriber</span><br><span class="line">wechat_subscriber:</span><br><span class="line">  enabled: true</span><br><span class="line">  qcode: &#x2F;uploads&#x2F;wechat-qcode.jpg</span><br><span class="line">  description: 欢迎您扫一扫上面的微信公众号，订阅我的博客！</span><br></pre></td></tr></table></figure>

<h3 id="设置动画效果"><a href="#设置动画效果" class="headerlink" title="设置动画效果"></a>设置动画效果</h3><p>主题配置文件设置。比较在乎速度，可以关闭动画。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"># Use velocity to animate everything.</span><br><span class="line">motion:</span><br><span class="line">  enable: true</span><br><span class="line">  async: false</span><br><span class="line">  transition:</span><br><span class="line">    # Transition variants:</span><br><span class="line">    # fadeIn | fadeOut | flipXIn | flipXOut | flipYIn | flipYOut | flipBounceXIn | flipBounceXOut | flipBounceYIn | flipBounceYOut</span><br><span class="line">    # swoopIn | swoopOut | whirlIn | whirlOut | shrinkIn | shrinkOut | expandIn | expandOut</span><br><span class="line">    # bounceIn | bounceOut | bounceUpIn | bounceUpOut | bounceDownIn | bounceDownOut | bounceLeftIn | bounceLeftOut | bounceRightIn | bounceRightOut</span><br><span class="line">    # slideUpIn | slideUpOut | slideDownIn | slideDownOut | slideLeftIn | slideLeftOut | slideRightIn | slideRightOut</span><br><span class="line">    # slideUpBigIn | slideUpBigOut | slideDownBigIn | slideDownBigOut | slideLeftBigIn | slideLeftBigOut | slideRightBigIn | slideRightBigOut</span><br><span class="line">    # perspectiveUpIn | perspectiveUpOut | perspectiveDownIn | perspectiveDownOut | perspectiveLeftIn | perspectiveLeftOut | perspectiveRightIn | perspectiveRightOut</span><br><span class="line">    post_block: fadeIn</span><br><span class="line">    post_header: slideDownIn</span><br><span class="line">    post_body: slideDownIn</span><br><span class="line">    coll_header: slideLeftIn</span><br><span class="line">    # Only for Pisces | Gemini.</span><br><span class="line">    sidebar: slideUpIn</span><br></pre></td></tr></table></figure>

<h3 id="设置背景动画"><a href="#设置背景动画" class="headerlink" title="设置背景动画"></a>设置背景动画</h3><p>编辑 主题配置文件， 搜索 <code>canvas_nest</code> 或 <code>three_waves</code>，根据您的需求设置值为 true 或者 false 即可</p>
<p>我只启用了 canvas_nest</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">canvas_nest: &#x2F;&#x2F;cdn.jsdelivr.net&#x2F;gh&#x2F;theme-next&#x2F;theme-next-canvas-nest@1.0.0&#x2F;canvas-nest.min.js</span><br><span class="line">canvas_nest_nomobile: &#x2F;&#x2F;cdn.jsdelivr.net&#x2F;gh&#x2F;theme-next&#x2F;theme-next-canvas-nest@1&#x2F;canvas-nest-nomobile.min.js</span><br></pre></td></tr></table></figure>

<h3 id="搜索–Local-Search"><a href="#搜索–Local-Search" class="headerlink" title="搜索–Local Search"></a>搜索–Local Search</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-generator-searchdb --save</span><br></pre></td></tr></table></figure>

<p>站点配置文件，新增如下内容：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">search:</span><br><span class="line">  path: search.xml</span><br><span class="line">  field: post</span><br><span class="line">  format: html</span><br><span class="line">  limit: 10000</span><br></pre></td></tr></table></figure>

<p>编辑主题配置文件，启用本地搜索：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># Local search</span><br><span class="line">local_search:</span><br><span class="line">  enable: true</span><br></pre></td></tr></table></figure>

<h3 id="不蒜子统计"><a href="#不蒜子统计" class="headerlink" title="不蒜子统计"></a>不蒜子统计</h3><p>编辑 主题配置文件 中的 <code>busuanzi_count</code> 的配置项：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">busuanzi_count:</span><br><span class="line">  enable: true</span><br><span class="line">  total_visitors: true</span><br><span class="line">  total_visitors_icon: user</span><br><span class="line">  total_views: true</span><br><span class="line">  total_views_icon: eye</span><br><span class="line">  # 文章阅读次数，关闭，避免与leanclound_visitors冲突</span><br><span class="line">  post_views: false</span><br><span class="line">  post_views_icon: eye</span><br></pre></td></tr></table></figure>

<h3 id="fancybox"><a href="#fancybox" class="headerlink" title="fancybox"></a>fancybox</h3><div class="note info">
            <p>fancyBox is a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages</p>
          </div>


<ul>
<li>检查<code>_config.yml</code> 中是否开启了 fancybox</li>
<li>找到 vendors，把 <code>fancybox</code> 和 <code>fancybox_css</code> 设置成推荐值</li>
</ul>
<p>参考：</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvaGV4by10aGVtZS1uZXh0L2lzc3Vlcy81OTM=" title="https://github.com/theme-next/hexo-theme-next/issues/593">文章里面的图片点击没有反应，也没有放大效果 [solved]<i class="fa fa-external-link"></i></span></li>
</ul>
<h3 id="内容分享"><a href="#内容分享" class="headerlink" title="内容分享"></a>内容分享</h3><p><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3RoZW1lLW5leHQvdGhlbWUtbmV4dC1uZWVkbW9yZXNoYXJlMg==" title="https://github.com/theme-next/theme-next-needmoreshare2">theme-next-needmoreshare2<i class="fa fa-external-link"></i></span>：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cd themes&#x2F;next</span><br><span class="line">git clone https:&#x2F;&#x2F;github.com&#x2F;theme-next&#x2F;theme-next-needmoreshare2 source&#x2F;lib&#x2F;needsharebutton</span><br></pre></td></tr></table></figure>

<p>主题配置文件配置：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">needmoreshare2:</span><br><span class="line">  enable: true</span><br><span class="line">  postbottom:</span><br><span class="line">    enable: true</span><br><span class="line">    options:</span><br><span class="line">      iconStyle: box</span><br><span class="line">      boxForm: horizontal</span><br><span class="line">      position: bottomCenter</span><br><span class="line">      networks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook</span><br><span class="line">  float:</span><br><span class="line">    enable: false</span><br><span class="line">    options:</span><br><span class="line">      iconStyle: box</span><br><span class="line">      boxForm: horizontal</span><br><span class="line">      position: middleRight</span><br><span class="line">      networks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook</span><br></pre></td></tr></table></figure>

<h3 id="评论"><a href="#评论" class="headerlink" title="评论"></a>评论</h3><p>Next 评论配置很简单，支持很丰富。</p>
<p><code>front matter</code> 中设置 <code>comments: false</code>，当前页就不会显示评论框了。</p>
<h4 id="Disqus-评论启用，但是得网络畅通才能看到："><a href="#Disqus-评论启用，但是得网络畅通才能看到：" class="headerlink" title="Disqus 评论启用，但是得网络畅通才能看到："></a>Disqus 评论启用，但是得网络畅通才能看到：</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">disqus:</span><br><span class="line">  enable: true</span><br><span class="line">  shortname: xxx</span><br><span class="line">  count: true</span><br></pre></td></tr></table></figure>

<p>编辑 主题配置文件， 将 disqus 下的 enable 设定为 true，同时提供您的 shortname。count 用于指定是否显示评论数量</p>
<h4 id="Valine"><a href="#Valine" class="headerlink" title="Valine"></a>Valine</h4><p><span class="exturl" data-url="aHR0cHM6Ly92YWxpbmUuanMub3JnL2F2YXRhci5odG1s" title="https://valine.js.org/avatar.html">Valine<i class="fa fa-external-link"></i></span>这个评论系统也是用到了 <span class="exturl" data-url="aHR0cHM6Ly9sZWFuY2xvdWQuY24vZGFzaGJvYXJkL2FwcC5odG1sP2FwcGlkPTdDRHRyYmI0VTduUXpPZGN0bVhYbk1xdC1nekd6b0hzeiMvZ2VuZXJhbA==" title="https://leancloud.cn/dashboard/app.html?appid=7CDtrbb4U7nQzOdctmXXnMqt-gzGzoHsz#/general">leancloud<i class="fa fa-external-link"></i></span></p>
<ul>
<li>点击登录或注册Leancloud;</li>
<li>创建应用(如果已经创建了博客应用，就不用再创建了)</li>
<li>获取 APP ID 和 APP KEY: 刚刚创建的应用 &gt; 设置 &gt; 应用 KEY</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">valine:</span><br><span class="line">  enable: false # When enable is set to be true, leancloud_visitors is recommended to be closed for the re-initialization problem within different leancloud adk version.</span><br><span class="line">  appid:  xxx # your leancloud application appid</span><br><span class="line">  appkey:  xxx # your leancloud application appkey</span><br><span class="line">  notify: true # mail notifier , https:&#x2F;&#x2F;github.com&#x2F;xCss&#x2F;Valine&#x2F;wiki https:&#x2F;&#x2F;valine.js.org&#x2F;notify.html</span><br><span class="line">  verify: true # Verification code</span><br><span class="line">  placeholder: ヾﾉ≧∀≦)o来啊，快活啊!  # comment box placeholder</span><br><span class="line">  avatar: identicon # wavatar retro gravatar style https:&#x2F;&#x2F;github.com&#x2F;xCss&#x2F;Valine&#x2F;wiki&#x2F;avatar-setting-for-valine</span><br><span class="line">  guest_info: nick,mail,link # custom comment header</span><br><span class="line">  pageSize: 10 # pagination size</span><br><span class="line">  visitor: true # leancloud-counter-security is not supported for now. When visitor is set to be true, appid and appkey are recommended to be the same as leancloud_visitors&#39; for counter compatibility. Article reading statistic https:&#x2F;&#x2F;valine.js.org&#x2F;visitor.html</span><br></pre></td></tr></table></figure>

<ul>
<li>visitor 文章访问量统计。</li>
<li>recordIP，默认是 fasle，是否记录评论者IP</li>
<li><span class="exturl" data-url="aHR0cHM6Ly92YWxpbmUuanMub3JnL2NvbmZpZ3VyYXRpb24uaHRtbA==" title="https://valine.js.org/configuration.html">valine 配置项查看<i class="fa fa-external-link"></i></span></li>
</ul>
<p>头像设置，可以用你对应的邮箱设置 <span class="exturl" data-url="aHR0cDovL2NuLmdyYXZhdGFyLmNvbS8=" title="http://cn.gravatar.com/">Gravatar<i class="fa fa-external-link"></i></span>，这样你评论时，就是注册时使用的邮箱了。</p>
<p>邮件提醒，进入Leancloud&gt;选择你的评论所存放的应用&gt;设置&gt;邮件模板，按下图设置好用于重置密码的邮件主题&gt;然后保存:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;p&gt;Hi, &#123;&#123;username&#125;&#125;&lt;&#x2F;p&gt;</span><br><span class="line">&lt;p&gt;</span><br><span class="line">你在 &#123;&#123;appname&#125;&#125; 的评论收到了新的回复，请点击查看：</span><br><span class="line">&lt;&#x2F;p&gt;</span><br><span class="line">&lt;p&gt;&lt;a href&#x3D;&quot;https:&#x2F;&#x2F;michael728.github.io&#x2F;&quot; style&#x3D;&quot;display: inline-block; padding: 10px 20px; border-radius: 4px; background-color: #3090e4; color: #fff; text-decoration: none;&quot;&gt;马上查看&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;</span><br></pre></td></tr></table></figure>

<p>参考：</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3poYW9qdW4xOTk4L1ZhbGluZS1BZG1pbg==" title="https://github.com/zhaojun1998/Valine-Admin">valine-admin<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9pby1vaS5tZS90ZWNobm9sb2d5L2NvbXB1dGVyL2NvbXB1dGVyLWFpZGVkLWFydC8yMDE4LzA3LzE1L3VzZS12YWxpbmUtaW4tdGhlbWUtbmV4dC5odG1s" title="https://io-oi.me/technology/computer/computer-aided-art/2018/07/15/use-valine-in-theme-next.html">在 NexT 中使用 Valine 评论系统<i class="fa fa-external-link"></i></span></li>
</ul>
<h3 id="hexo-next-新增阅读排行页面"><a href="#hexo-next-新增阅读排行页面" class="headerlink" title="hexo next 新增阅读排行页面"></a>hexo next 新增阅读排行页面</h3><p>参考这两个教程：</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9ob3hpcy5naXRodWIuaW8vaGV4by1uZXh0LXJlYWQtcmFuay5odG1s" title="https://hoxis.github.io/hexo-next-read-rank.html">hexo next 新增阅读排行页面<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9pby1vaS5tZS90ZWNobm9sb2d5L2NvbXB1dGVyL2NvbXB1dGVyLWFpZGVkLWFydC8yMDE3LzA2LzA5L2hleG8tbmV4dC1vcHRpbWl6YXRpb24uaHRtbA==" title="https://io-oi.me/technology/computer/computer-aided-art/2017/06/09/hexo-next-optimization.html">打造个性超赞博客Hexo+NexT+GitHubPages的超深度优化<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9pby1vaS5tZS90ZWNobm9sb2d5L2NvbXB1dGVyL2NvbXB1dGVyLWFpZGVkLWFydC8yMDE4LzA3LzE1L3VzZS12YWxpbmUtaW4tdGhlbWUtbmV4dC5odG1s" title="https://io-oi.me/technology/computer/computer-aided-art/2018/07/15/use-valine-in-theme-next.html">在 NexT 中使用 Valine 评论系统<i class="fa fa-external-link"></i></span></li>
</ul>
<h3 id="在Hexo博客中加入豆瓣读书页面"><a href="#在Hexo博客中加入豆瓣读书页面" class="headerlink" title="在Hexo博客中加入豆瓣读书页面"></a>在Hexo博客中加入豆瓣读书页面</h3><p><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL215dGhzbWFuL2hleG8tZG91YmFu" title="https://github.com/mythsman/hexo-douban">hexo-douban<i class="fa fa-external-link"></i></span> 可以实现生成豆瓣读书、电影、游戏的页面。具体的使用方法可以看项目的主页或者这篇文章</p>
<ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9iZXN0enVvLmNuL3Bvc3RzL2hleG8tZG91YmFuLmh0bWw=" title="https://bestzuo.cn/posts/hexo-douban.html">在Hexo博客中加入豆瓣读书页面<i class="fa fa-external-link"></i></span></li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo douban -bm &amp;&amp; hexo g &amp;&amp;hexo deploy</span><br></pre></td></tr></table></figure>

<h3 id="看板娘"><a href="#看板娘" class="headerlink" title="看板娘"></a>看板娘</h3><ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL0VZSE4vaGV4by1oZWxwZXItbGl2ZTJk" title="https://github.com/EYHN/hexo-helper-live2d">EYHN/hexo-helper-live2d<i class="fa fa-external-link"></i></span> Hexo 博客照着配置就行</li>
<li><span class="exturl" data-url="aHR0cHM6Ly9odWFqaTgudG9wL3Bvc3QvbGl2ZTJkLXBsdWdpbi0yLjAv" title="https://huaji8.top/post/live2d-plugin-2.0/">live2d-看板娘预览<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly8xMS50dC9wb3N0cy8yMDE4L2hvdy10by1wbGF5LXdpdGgtbGl2ZTJkLW9uLWhleG8v" title="https://11.tt/posts/2018/how-to-play-with-live2d-on-hexo/">用Live2D让看板喵入住你的Hexo博客吧(^o^)/~<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9pbWphZC5jbi9hcmNoaXZlcy9sYWIvYWRkLWR5bmFtaWMtcG9zdGVyLWdpcmwtd2l0aC1saXZlMmQtdG8teW91ci1ibG9nLTAx" title="https://imjad.cn/archives/lab/add-dynamic-poster-girl-with-live2d-to-your-blog-01">给博客添加能动的看板娘(Live2D)-关于模型的二三事<i class="fa fa-external-link"></i></span> Hexo 博客看板娘配置进阶</li>
<li><span class="exturl" data-url="aHR0cHM6Ly93d3cuY25ibG9ncy5jb20vYmFycnl6aGFuZy9wLzEwNTM1OTYwLmh0bWw=" title="https://www.cnblogs.com/barryzhang/p/10535960.html">博客园添加Live2d看板娘<i class="fa fa-external-link"></i></span> 博客园增加看板娘</li>
</ul>
<h3 id="SEO-优化"><a href="#SEO-优化" class="headerlink" title="SEO 优化"></a>SEO 优化</h3><ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9ob3hpcy5naXRodWIuaW8vSGV4bytOZXh0JTIwU0VPJUU0JUJDJTk4JUU1JThDJTk2Lmh0bWw=" title="https://hoxis.github.io/Hexo+Next%20SEO%E4%BC%98%E5%8C%96.html">Hexo博客Next主题SEO优化方法<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly95Znpob3UuY29kaW5nLm1lLzIwMTgvMDgvMjkvSGV4by1OZXh0JUU2JTkwJUFEJUU1JUJCJUJBJUU0JUI4JUFBJUU0JUJBJUJBJUU1JThEJTlBJUU1JUFFJUEyJUVGJUJDJTg4U0VPJUU0JUJDJTk4JUU1JThDJTk2JUVGJUJDJTg5Lw==" title="https://yfzhou.coding.me/2018/08/29/Hexo-Next%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%EF%BC%88SEO%E4%BC%98%E5%8C%96%EF%BC%89/">Hexo-Next搭建个人博客（SEO优化）<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9tdGlhbnlhbi5naXRlZS5pby9wb3N0L2E2MjVmYTgyLmh0bWw=" title="https://mtianyan.gitee.io/post/a625fa82.html">Hexo+Next主题搭建博客安装美化及SEO优化指南<i class="fa fa-external-link"></i></span></li>
</ul>
<h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><ul>
<li><span class="exturl" data-url="aHR0cHM6Ly9taWNoYWVsNzI4LmdpdGh1Yi5pby8=" title="https://michael728.github.io/">Michael翔<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9jaGVudGdpbmcuZ2l0aHViLmlvLzIwMTgvMDUvMTQvaGV4byVFRiVCQyU5QSVFRiVCQyU4OCVFNCVCOCU4OSVFRiVCQyU4OWhleG8tTmV4dC0lRTQlQjglQkIlRTklQTIlOTglRTQlQjglOEIlRTglQkQlQkQlRTUlOTIlOEMlRTklODUlOEQlRTclQkQlQUUv" title="https://chentging.github.io/2018/05/14/hexo%EF%BC%9A%EF%BC%88%E4%B8%89%EF%BC%89hexo-Next-%E4%B8%BB%E9%A2%98%E4%B8%8B%E8%BD%BD%E5%92%8C%E9%85%8D%E7%BD%AE/">hexo：（三）hexo Next 主题下载和配置<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9yZXVpeGl5LmdpdGh1Yi5pby90ZWNobm9sb2d5L2NvbXB1dGVyL2NvbXB1dGVyLWFpZGVkLWFydC8yMDE3LzA2LzA5L2hleG8tbmV4dC1vcHRpbWl6YXRpb24uaHRtbA==" title="https://reuixiy.github.io/technology/computer/computer-aided-art/2017/06/09/hexo-next-optimization.html">打造个性超赞博客Hexo+NexT+GitHubPages的超深度优化<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9ibG9nLnJ1bm5pbmdjb2Rlci5tZS8yMDE4LzA0LzI2L2NyZWF0ZS1wZXJzb25hbC1ibG9nLXdpdGgtZ2l0aHViLWFuZC1oZXhvLVYv" title="https://blog.runningcoder.me/2018/04/26/create-personal-blog-with-github-and-hexo-V/">手摸手教你用github和hexo搭建个人博客（五）<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9zZWdtZW50ZmF1bHQuY29tL2EvMTE5MDAwMDAwOTU0NDkyNCNhcnRpY2xlSGVhZGVyMjM=" title="https://segmentfault.com/a/1190000009544924#articleHeader23">hexo的next主题个性化配置教程<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9pdW9rLm1lL3Bvc3RzLzI5MTE4MTAxNTQv" title="https://iuok.me/posts/2911810154/">NexT 主题的扩展以及设置<i class="fa fa-external-link"></i></span></li>
<li><span class="exturl" data-url="aHR0cHM6Ly9iZXN0enVvLmNuL3Bvc3RzL2Jsb2ctZXN0YWJsaXNoLmh0bWw=" title="https://bestzuo.cn/posts/blog-establish.html">Sanarous-使用Hexo+Next主题搭建自己的个人博客<i class="fa fa-external-link"></i></span></li>
</ul>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/javascript/" rel="tag"># javascript</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2019/08/09/%E5%89%8D%E7%AB%AF%E6%95%B0%E6%8D%AE%E6%93%8D%E4%BD%9C/" rel="prev" title="前端数据操作">
      <i class="fa fa-chevron-left"></i> 前端数据操作
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/01/13/gitConsole/" rel="next" title="git常用指令">
      git常用指令 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#概述"><span class="nav-number">1.</span> <span class="nav-text">概述</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#前提"><span class="nav-number">2.</span> <span class="nav-text">前提</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装-Hexo"><span class="nav-number">3.</span> <span class="nav-text">安装 Hexo</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#建站"><span class="nav-number">4.</span> <span class="nav-text">建站</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#部署"><span class="nav-number">5.</span> <span class="nav-text">部署</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#常用命令"><span class="nav-number">6.</span> <span class="nav-text">常用命令</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Hexo-写作技巧"><span class="nav-number">7.</span> <span class="nav-text">Hexo 写作技巧</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Note"><span class="nav-number">7.1.</span> <span class="nav-text">Note</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#使用主题自带-FontAwesome-图标"><span class="nav-number">7.2.</span> <span class="nav-text">使用主题自带 FontAwesome 图标</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#文本居中"><span class="nav-number">7.3.</span> <span class="nav-text">文本居中</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#主题自带-label-标签"><span class="nav-number">7.4.</span> <span class="nav-text">主题自带 label 标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#主题自带-tabs-标签"><span class="nav-number">7.5.</span> <span class="nav-text">主题自带 tabs 标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#主题自带样式按钮"><span class="nav-number">7.6.</span> <span class="nav-text">主题自带样式按钮</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Hexo-其他知识"><span class="nav-number">8.</span> <span class="nav-text">Hexo 其他知识</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#图床"><span class="nav-number">8.1.</span> <span class="nav-text">图床</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Next-主题"><span class="nav-number">9.</span> <span class="nav-text">Next 主题</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#安装-Next"><span class="nav-number">9.1.</span> <span class="nav-text">安装 Next</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#启动-Next-主题"><span class="nav-number">9.2.</span> <span class="nav-text">启动 Next 主题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#主题设置"><span class="nav-number">9.3.</span> <span class="nav-text">主题设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置语言"><span class="nav-number">9.4.</span> <span class="nav-text">设置语言</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置菜单"><span class="nav-number">9.5.</span> <span class="nav-text">设置菜单</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置头像"><span class="nav-number">9.6.</span> <span class="nav-text">设置头像</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#百度统计"><span class="nav-number">9.7.</span> <span class="nav-text">百度统计</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#阅读次数"><span class="nav-number">9.8.</span> <span class="nav-text">阅读次数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置-RSS"><span class="nav-number">9.9.</span> <span class="nav-text">设置 RSS</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#添加标签页面"><span class="nav-number">9.10.</span> <span class="nav-text">添加标签页面</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置字体"><span class="nav-number">9.11.</span> <span class="nav-text">设置字体</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置代码高亮主题"><span class="nav-number">9.12.</span> <span class="nav-text">设置代码高亮主题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#侧边栏社交链接"><span class="nav-number">9.13.</span> <span class="nav-text">侧边栏社交链接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#开启打赏功能"><span class="nav-number">9.14.</span> <span class="nav-text">开启打赏功能</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#友情链接"><span class="nav-number">9.15.</span> <span class="nav-text">友情链接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#站点建立时间"><span class="nav-number">9.16.</span> <span class="nav-text">站点建立时间</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#订阅微信公众号"><span class="nav-number">9.17.</span> <span class="nav-text">订阅微信公众号</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置动画效果"><span class="nav-number">9.18.</span> <span class="nav-text">设置动画效果</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置背景动画"><span class="nav-number">9.19.</span> <span class="nav-text">设置背景动画</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#搜索–Local-Search"><span class="nav-number">9.20.</span> <span class="nav-text">搜索–Local Search</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#不蒜子统计"><span class="nav-number">9.21.</span> <span class="nav-text">不蒜子统计</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#fancybox"><span class="nav-number">9.22.</span> <span class="nav-text">fancybox</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#内容分享"><span class="nav-number">9.23.</span> <span class="nav-text">内容分享</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#评论"><span class="nav-number">9.24.</span> <span class="nav-text">评论</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Disqus-评论启用，但是得网络畅通才能看到："><span class="nav-number">9.24.1.</span> <span class="nav-text">Disqus 评论启用，但是得网络畅通才能看到：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Valine"><span class="nav-number">9.24.2.</span> <span class="nav-text">Valine</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#hexo-next-新增阅读排行页面"><span class="nav-number">9.25.</span> <span class="nav-text">hexo next 新增阅读排行页面</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#在Hexo博客中加入豆瓣读书页面"><span class="nav-number">9.26.</span> <span class="nav-text">在Hexo博客中加入豆瓣读书页面</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#看板娘"><span class="nav-number">9.27.</span> <span class="nav-text">看板娘</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#SEO-优化"><span class="nav-number">9.28.</span> <span class="nav-text">SEO 优化</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#参考"><span class="nav-number">10.</span> <span class="nav-text">参考</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="王志超"
      src="/images/logo.png">
  <p class="site-author-name" itemprop="name">王志超</p>
  <div class="site-description" itemprop="description">记录前端的点点滴滴</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives">
          <span class="site-state-item-count">19</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL3d6YzU3MDczODIwNQ==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;wzc570738205"><i class="fa fa-fw fa-github"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly93d3cuY25ibG9ncy5jb20vd2FuZ3poaWNoYW8v" title="博客园 → https:&#x2F;&#x2F;www.cnblogs.com&#x2F;wangzhichao&#x2F;"><i class="fa fa-fw fa-globe"></i>博客园</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cDovL21haWwucXEuY29tL2NnaS1iaW4vcW1fc2hhcmU/dD1xbV9tYWlsbWUmZW1haWw9eHJHOHBmLXo5dkgzLTRhM3RfaWxxYXM=" title="E-Mail → http:&#x2F;&#x2F;mail.qq.com&#x2F;cgi-bin&#x2F;qm_share?t&#x3D;qm_mailme&amp;email&#x3D;xrG8pf-z9vH3-4a3t_ilqas"><i class="fa fa-fw fa-envelope"></i>E-Mail</span>
      </span>
      <span class="links-of-author-item">
        <a href="//shang.qq.com/wpa/qunwpa?idkey=f528775f242a7c39fe8512383febb8990e621bf97354c2fb82f6832097b7c501" target="_blank" rel="noopener" title="QQ群 → &#x2F;&#x2F;shang.qq.com&#x2F;wpa&#x2F;qunwpa?idkey&#x3D;f528775f242a7c39fe8512383febb8990e621bf97354c2fb82f6832097b7c501"><i class="fa fa-fw fa-qq"></i>QQ群</a>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cDovL3dhbmd6Yy53YW5nL3dlYnNvY2tldC8=" title="websocket → http:&#x2F;&#x2F;wangzc.wang&#x2F;websocket&#x2F;"><i class="fa fa-fw fa-comments"></i>websocket</span>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 2015 – 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">王志超</span>
</div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>




  




  
<script src="/js/local-search.js"></script>









<script>
if (document.querySelectorAll('div.pdf').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/pdfobject@2/pdfobject.min.js', () => {
    document.querySelectorAll('div.pdf').forEach(element => {
      PDFObject.embed(element.getAttribute('target'), element, {
        pdfOpenParams: {
          navpanes: 0,
          toolbar: 0,
          statusbar: 0,
          pagemode: 'thumbs',
          view: 'FitH'
        },
        PDFJS_URL: '/lib/pdf/web/viewer.html',
        height: element.getAttribute('height') || '700px'
      });
    });
  }, window.PDFObject);
}
</script>




  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el: '#valine-comments',
      verify: false,
      notify: false,
      appId: '9fgm6JVbw8PrOlvp7LfsKjsh-gzGzoHsz',
      appKey: 'LReLvzSwPnBOAz5LiIgJsiDO',
      placeholder: "说点什么吧",
      avatar: 'mm',
      meta: guest,
      pageSize: '10' || 10,
      visitor: false,
      lang: 'zh-cn' || 'zh-cn',
      path: location.pathname,
      recordIP: false,
      serverURLs: ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
